<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>代购就上代购岛，代购岛是一个透明、共赢的服务平台！-代购网-海外代购|奶粉代购|化妆品代购</title>
<meta name="keywords" content="www.taobao.com,代购岛,代购网,代购,tao bao,daigou,淘宝代购,保健品代购,lv,coach代购,奶粉代购,正品代购，网上购物,网,代购" />
<meta name="description" content="代购岛是一个专注于代购领域的服务交易平台，是目前唯一一家以服务的形式提供代购业务的公司。在这里,用户可以雇佣经纪人代购自己需要的商品;愿意跑腿的人可以申请做经纪人,通过提供代购服务赚取佣金。代购岛网站倡导健康、优雅的品质生活,致力于营造诚信、分享的共赢文化，力图让每个人都可以足不出户代购全球优质商品." /> 
<link href="<%=path%>/css/main.css" rel="stylesheet" type="text/css" />
<link href="<%=path%>/css/ui-lightness/jquery.custom.css" rel="stylesheet" type="text/css" />
<link href="<%=path%>/css/pshow.css" type="text/css" rel="stylesheet"/>	

<script src="<%=path%>/script/tab.js"></script>
<script src="<%=path%>/script/resizeimg.js"></script>
		<script type="text/javascript" src="<%=path%>/script/jquery.js"></script>
		<script type="text/javascript" src="<%=path%>/script/jquery.datePicker-min.js"></script>
		<script type="text/javascript" src="<%=path%>/script/jquery.custom.js"></script>
		<script type="text/javascript" src="<%=path%>/script/jquery.iappm.js"></script>
		<script type="text/javascript" src="<%=path%>/script/jquery.tab.js"></script>
		<script type="text/javascript" src="<%=path%>/script/jquery.common.js"></script>
		<script type="text/javascript" src="<%=path%>/script/jquery.ie6.js"></script>
		<script type="text/javascript" src="<%=path%>/script/jquery.my.js"></script>
		<script type="text/javascript" src="<%=path%>/script/jquery.automatic.js"></script>
		<script src="<%=path%>/script/pshow.base.js" type=text/javascript></script>
		<script src="<%=path%>/script/resizeimg.js"></script>
		<script src="<%=path%>/script/input.js"></script>
		<script src="<%=path%>/script/tab.js"></script>
		<script src="<%=path%>/script/pshow.lib.js" type=text/javascript></script>
		<script src="<%=path%>/script/pshow.js" type=text/javascript></script>
		<script src="<%=path%>/script/common.js" type=text/javascript></script>
		<script src="<%=path%>/script/jquery.form.js" type=text/javascript></script>
		<script src="<%=path%>/script/My97DatePicker/WdatePicker.js" type=text/javascript></script>
<style>
html,body{height:100%;}
body,div,h2{margin:0;padding:0;}
body{font:12px/1.5 Tahoma;}
center{padding-top:10px;}
#overlay{position:absolute;top:0;left:0;width:100%;height:100%;background:#666;opacity:0.5;filter:alpha(opacity=50);display:none;z-index:998;
position:fixed!important;/*FF IE7*/
position:absolute;/*IE6*/
_top:       expression(eval(document.compatMode &&
            document.compatMode=='CSS1Compat') ?
            documentElement.scrollTop + (document.documentElement.clientHeight-this.offsetHeight)/2 :/*IE6*/
            document.body.scrollTop + (document.body.clientHeight - this.clientHeight)/2);/*IE5 IE5.5*/}
#win{position:absolute;top:35%;left:48%;width:400px;height:245px;background:#fff;border:2px solid #a00000;display:none;z-index:999;
left:50%;
top:50%;
margin-left:-150px!important;/*FF IE7 该值为本身宽的一半 */
margin-top:-60px!important;/*FF IE7 该值为本身高的一半*/
margin-top:0px;
position:fixed!important;/* FF IE7*/
position:absolute;/*IE6*/
_top:       expression(eval(document.compatMode &&
            document.compatMode=='CSS1Compat') ?
            documentElement.scrollTop + (document.documentElement.clientHeight-this.offsetHeight)/2 :/*IE6*/
            document.body.scrollTop + (document.body.clientHeight - this.clientHeight)/2);/*IE5 IE5.5*/}

h2{font-size:12px;height:18px;text-align:right;background:#A10;border-bottom:0px solid #f90;padding:5px;cursor:move;}
h2 span{color:#f90;cursor:pointer;background:#fff;border:0px solid #f90;padding:0 0px;}
</style>

<script>
window.onload = function ()
{
	var oWin = document.getElementById("win");
	var oLay = document.getElementById("overlay");	
	var oClose = document.getElementById("close");
	var oH2 = oWin.getElementsByTagName("h2")[0];
	var bDrag = false;
	var disX = disY = 0;
	oClose.onclick = function ()
	{
		oLay.style.display = "none";
		oWin.style.display = "none";
		
	};
	oClose.onmousedown = function (event)
	{
		(event || window.event).cancelBubble = true;
	};
	oH2.onmousedown = function (event)
	{		
		var event = event || window.event;
		bDrag = true;
		disX = event.clientX - oWin.offsetLeft;
		disY = event.clientY - oWin.offsetTop;		
		this.setCapture && this.setCapture();		
		return false;
	};
	document.onmousemove = function (event)
	{
		if (!bDrag) return;
		var event = event || window.event;
		var iL = event.clientX - disX;
		var iT = event.clientY - disY;
		var maxL = document.documentElement.clientWidth - oWin.offsetWidth;
		var maxT = document.documentElement.clientHeight - oWin.offsetHeight;		
		iL = iL < 0 ? 0 : iL;
		iL = iL > maxL ? maxL : iL; 		
		iT = iT < 0 ? 0 : iT;
		iT = iT > maxT ? maxT : iT;
		
		oWin.style.marginTop = oWin.style.marginLeft = 0;
		oWin.style.left = iL + "px";
		oWin.style.top = iT + "px";		
		return false;
	};
	document.onmouseup = window.onblur = oH2.onlosecapture = function ()
	{
		bDrag = false;				
		oH2.releaseCapture && oH2.releaseCapture();
	};
};
</script>

<script>
$(function(){
	$("#cart").click(showCart);
	
	$("#aLogin").click(doLogin);
	
	$("#apwd").bind('keyup',function(event) {
		if(event.keyCode==13){
			doLogin();
		}
	});
}); 

var to = 0;
var fUserId = 0;
var lUserId = 0;
var bLogin = false;

var doLogin = function(){
	var mail = $("#amail").val();
	var pwd = $("#apwd").val();
	
	if(!mail && !pwd){
		$("#msg").html("<font color='red'>请输入您的登录邮箱和密码</font>");
		return;
	}
	
	if(!mail){
		$("#msg").html("<font color='red'>请输入您的登录邮箱</font>");
		return;
	}
	
	if(!pwd){
		$("#msg").html("<font color='red'>请输入您的密码</font>");
		return;
	}
	
	$.ajax({
		type:"POST",
		url:"aLogin.htm",
		data:{email:mail, pwd:pwd},
		datatype:"text",
		success:function(data){
			if(data == ""){
				$("#msg").html("<font color='red'>用户名或者密码错误!</font>");
			}else{
				bLogin = true;
				closeLogin();
				var array = data.split("|");
				lUserId = array[0];
				$("#welcome").html("您好，"+array[1]+"&nbsp;&nbsp;<a style='color:#A10000' href='<%=path%>/logout.htm'>退出登录</a>");
				call();
			}
	    }
	});
};

//登录成功后的适配器函数
var call = function(){
	if(0==to){
		showCart();
	}else if(1==to){
		newDaiGou();
	}else if(2==to){
		newQiouGou();
	}else if(3==to){
		follow(fUserId, 3);
	}else if(4==to){
		follow(fUserId, 4);
	}else if(5==to){
		follow(fUserId, 5);
	}
};

var showLogin = function(){
	var oLay = document.getElementById("overlay");
	var oWin = document.getElementById("win"); 
	oLay.style.display = "block";
	oWin.style.display = "block";
};

var closeLogin = function(){
	var oLay = document.getElementById("overlay");
	var oWin = document.getElementById("win"); 
	oLay.style.display = "none";
	oWin.style.display = "none";
};

var showCart = function(){
	var userObj = "${sessionScope.user}";
	if(userObj == '' && !bLogin){
		to = 0;
		showLogin();
	}else{
		//老蒋修改这部分
		window.open("cart.htm", "_blank");
	}
};
</script>


</head>
<body>
<div id="overlay"  ></div>
<div id="win">
<h2><div class="wrap_left"><span class="span_denglu">登陆代购岛</span></div>
<span id="close"><img src="images/close1.png" border="0"/></span></h2>

	<div class="reg_main1">
				<div id="msg" align="center"></div>
            	<li>登录邮箱：<input id="amail" type="text" class="input1" /></li>
                <li>登录密码：<input id="apwd" type="password" class="input1" /></li>
              <li><div id="button" class="login_but"><span style=" margin-left:0px"><input type="button" class="login" id="aLogin" value="登&nbsp;&nbsp;录" style="cursor:pointer"/></span></div>
<a href="<%=path%>/retrievepassword.htm"><span class="span_wjmm">忘记密码了？</span></a>
<a href="<%=path%>/new_register.htm"><span class="span_ljzc">立即注册</span></a>
</li>
            </div>
</div>
<div class="wrap0">
	<!--顶部开始-->
	<div class="top1">
		<div class="wrap1_help">
			<s:if test="#session.user==null||#session.user.isEmpty()">
    			<div id="welcome" class="wrap_left head_font">倡导品质生活,营造共营文化,让每个人都可以足不出户畅享全球品质商品!&nbsp;&nbsp;<span style="color:#A10000"><a style="color:#A10000" href="<%=path%>/login.htm">[ 登录</a>&nbsp;&nbsp;| &nbsp;&nbsp;<a style="color:#A10000" href="<%=path%>/new_register.htm">免费注册  ]</a></span></div>
            </s:if>
            <s:else>
     			<div class="wrap_left">您好，${sessionScope.user.nickName}&nbsp;&nbsp;<a style="color:#A10000" href="<%=path%>/logout.htm">退出登录</a></div>
     		</s:else>
				<div class="wrap_right right">
					<div class="list_box_top head_font">
						<ul>
						   <li>
						    <a href="<%=path%>/main.htm">返回首页</a>&nbsp;&nbsp;&nbsp;&nbsp;</li>
						    <li><a id="cart" style="cursor:pointer">代购车<span id="cartNum" style="color: red"><s:if
								test="#session.cart == null">0</s:if>
							<s:else>
								<s:property value="#session.cart.size" />
							</s:else></span>件</a>
							</li>
							<li><a href="<%=path%>/accountinit.htm" class="sub">&nbsp;&nbsp;我的代购岛 
									<!--[if IE 7]><!-->
							</a> <!--<![endif]--> <!--[if lte IE 6]><table><tr><td><![endif]-->
								<ul>
									<li><a href="<%=path%>/accountinit.htm" class="sub">&nbsp;&nbsp;我的代购岛 </a></li>
									<li><a href="<%=path%>/initShopinfo.htm">我发布的代购信息</a></li>
									<li><a href="<%=path%>/initWantBuyInfo.htm">我发布的求购信息</a></li>
								</ul> <!--[if lte IE 6]></td></tr></table></a><![endif]--></li>

							<li><a href="<%=path%>/help/help.jsp">帮助中心</a></li>
						</ul>
					</div>
            <div class="clear"></div> 
    	</div>
	</div>
    </div>
    
    <div class="wrap1_help">
    	<div class="top3">
    		<div class="wrap_left"><div class="box_logo"><a href="<%=path%>/main.htm"><img src="<%=path%>/images/logo.png" /></a></div></div>
        	<div class="wrap_left">
				<div class="help_box">
					<span class="f1">帮助中心</span><br />
					<span class="f2">HELP CENTER</span>
				</div>
			</div>

    </div>
    </div>
<!--顶部结束-->
<div class="clear"></div> 

